#!/bin/sh
#替换树莓派源为国内

cp /etc/apt/source.list /etc/apt/source_back.list

cat > /etc/apt/source.list <<EOF
deb http://mirrors.aliyun.com/debian/ bullseye main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ bullseye main non-free contrib
deb http://mirrors.aliyun.com/debian-security/ bullseye-security main
deb-src http://mirrors.aliyun.com/debian-security/ bullseye-security main
deb http://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib
EOF

cp /etc/apt/sources.list.d/raspi.list /etc/apt/sources.list.d/raspi_back.list

cat > /etc/apt/sources.list.d/raspi.list <<EOF
deb http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ buster main
deb-src http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ buster main
EOF